<?php

namespace Acme\FileManagerBundle\Entity;

class Directory extends BaseFile
{
    public function getSlug()
    {
        return $this->getRelativePath() . '/';
    }
    
    public function getPermissions()
    {
        if (!$this->m_permissions)
        {
            // bug fix
            $this->m_permissions = ($this->m_path) ? \substr(\decoct(\fileperms($this->m_path)), -4) : '0755';
        }
        
        return $this->m_permissions;
    }
    
    public function getType()
    {
        return 'directory';
    }
}